package com.calendar.add;

import com.calendar.widget.R;

import android.R.string;
import android.app.Activity;
import android.app.Dialog;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TimePicker;

public class AddView extends Activity {

	int starthour, startmin, endhour, endmin;
	string name, location, Description, attendees;

	static final int TIME_DIALOG_ID = 0;

	/** Called when the activity is first created. */
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.add_view);

		// Use bundle to load everything back in

		final Button done = (Button) findViewById(R.id.Done);
		done.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				// save everything to db. to be filled in
			}

		});
		final Button cancel = (Button) findViewById(R.id.Cancel);
		cancel.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				// don't save anything and return to previous view.
			}
		});
		final Button delete = (Button) findViewById(R.id.Delete);
		delete.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				// TODO
				// remove entry from database.
			}
		});
	}

	public void onPause() {
		// save into bundle.
	}

	protected Dialog onCreateDialog(int id) {
		switch (id) {
		case TIME_DIALOG_ID:
			return new TimePickerDialog(this, mTimeSetListener, starthour,
					startmin, false);
		}
		return null;
	}

	private TimePickerDialog.OnTimeSetListener mTimeSetListener = new TimePickerDialog.OnTimeSetListener() {

		public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
			// TODO Auto-generated method stub

		}
	};
}